﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using qna.Services;
using qna.Controls;
using qna.Business;

namespace qna.pages {
	public partial class Question : System.Web.UI.Page {
		protected void Page_Load(object sender, EventArgs e) {
			if (Request.QueryString["view"] != null) {
				QuestionControl qc = (QuestionControl)LoadControl("~/Controls/QuestionControl.ascx");
				qc.Question = (Business.Question)(new QuestionService()).Get(Convert.ToInt32(Request.QueryString["view"]));
				panel.Controls.Add(qc);
			} else {
				Response.StatusCode = 404;
				title.Visible = true;
				title.InnerText = "Page not found";
			}
		}
	}
}